﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace YXShop.Web.membercenter.circlereview
{
    public partial class shortmessage_detail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (ChangeHope.WebPage.PageRequest.GetInt("id") > 0)
                {
                    BandInfo(ChangeHope.WebPage.PageRequest.GetInt("id"));
                }
            }
        }

        protected void BandInfo(int id)
        {
            YXShop.BLL.Member.MailReceiver bll = new YXShop.BLL.Member.MailReceiver();
            YXShop.Model.Member.MailReceiver model = bll.GetModelByID(id);
            bll.Amend(id, "isread", 1); //已阅
            this.lblSendUser.Text = model.Sender;
            this.lblSendTime.Text = model.ReceiveTime.ToString();
            this.lblTitle.Text = model.Title;
            this.lblContent.Text = model.Body;
            
        }

        protected void btnReply_Click(object sender, EventArgs e)
        {
            string query = "userid=" + this.lblSendUser.Text + "&option=reply";
            string url = YXShop.TemplateAction.Common.UrlStr("shortmessage_create", query, "membercenter/circlereview/");
            Response.Redirect(url);
        }

        protected void btnReSend_Click(object sender, EventArgs e)
        {
            string query = "content=" + this.lblContent.Text + "&option=resend";
            string url = YXShop.TemplateAction.Common.UrlStr("shortmessage_create", query, "membercenter/circlereview/");
            Response.Redirect(url);
        }

        protected void btnCreate_Click(object sender, EventArgs e)
        {
            string url = YXShop.TemplateAction.Common.UrlStr("shortmessage_create", "", "membercenter/circlereview/");
            Response.Redirect(url);
        }

        
    }
}
